build: fix win32 configure checks
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 10 Jun 2011 12:03:47 +0000 (14:03 +0200)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 10 Jun 2011 18:13:12 +0000 (20:13 +0200)
Notice the broken check for "os_win32" vs. "$os_win32".
Improve a bit the rest of autofoo stuff around it.

https://bugzilla.gnome.org/show_bug.cgi?id=652282

configure.ac

index 22943e3a676510f13e11ee41d9453a48e4089b0a..f950f75b5765a51baf820b7b57ae4085ad9b3a10 100644 (file)
@@ -1519,16 +1519,29 @@ GOBJECT_INTROSPECTION_CHECK(introspection_required_version)
 #################################################
 
 AC_ARG_ENABLE(packagekit,
-              [AS_HELP_STRING([--disable-packagekit],
-                              [build packagekit open-with module])])
+              [AS_HELP_STRING([--enable-packagekit=@<:@yes/no/auto@:>@],
+                              [build packagekit open-with module [default=auto]])],
+              [enable_packagekit="$enableval"],
+              [enable_packagekit=auto])
+if test "$enable_packagekit" = "auto"; then
+  if test "$os_win32" = "yes"; then
+    enable_packagekit=no
+  else
+    enable_packagekit=yes
+  fi
+fi
 
+AC_MSG_CHECKING([Whether to use PackageKit])
 build_packagekit=no
-if test "os_win32" != "yes"; then
-        if test "x$enable_packagekit" != "xno"; then
-                build_packagekit=yes
-                AC_DEFINE(ENABLE_PACKAGEKIT, 1, [define to enable packagekit])
-        fi
+if test "x$enable_packagekit" != "xno"; then
+  if test "$os_win32" != "yes"; then
+    build_packagekit=yes
+    AC_DEFINE(ENABLE_PACKAGEKIT, 1, [define to enable packagekit])
+  else
+    AC_MSG_ERROR([packagekit support is not available on win32])
+  fi
 fi
+AC_MSG_RESULT([$build_packagekit])
 
 AM_CONDITIONAL(ENABLE_PACKAGEKIT, test "x$build_packagekit" = "xyes")
 
@@ -1537,12 +1550,22 @@ AM_CONDITIONAL(ENABLE_PACKAGEKIT, test "x$build_packagekit" = "xyes")
 #################################################
 
 AC_ARG_ENABLE(colord,
-              [AS_HELP_STRING([--disable-colord],
-                              [build colord support code])])
+              [AS_HELP_STRING([--enable-colord=@<:@yes/no/auto@:>@],
+                              [build colord support code [default=auto]])],
+              [enable_colord="$enableval"],
+              [enable_colord=auto])
+if test "$enable_colord" = "auto"; then
+  if test "$os_win32" = "yes"; then
+    enable_colord=no
+  else
+    enable_colord=yes
+  fi
+fi
 
+AC_MSG_CHECKING([Whether to use colord])
 have_colord=no
 if test "x$enable_colord" != "xno"; then
-        if test "os_win32" != "yes"; then
+        if test "$os_win32" != "yes"; then
                 PKG_CHECK_MODULES(COLORD, colord >= 0.1.9,
                                   have_colord=yes, have_colord=no)
                 if test "enable_colord" = "yes"; then
@@ -1554,6 +1577,7 @@ if test "x$enable_colord" != "xno"; then
                 AC_MSG_ERROR([colord support is not available on win32])
         fi
 fi
+AC_MSG_RESULT([$have_colord])
 
 if test "have_colord" = "yes"; then
         AC_DEFINE(HAVE_COLORD, 1, [define if we have colord])